<div class="row animated" ng-class="{true: 'fadeInRight', false:'fadeInLeft'}[currentAnimated]">
  <div class="panel panel-default">
    <div class="panel-heading">
      <a ng-click="discard()" href="javascript:;"><i class="backBtn fa fa-arrow-circle-left"></i></a>
      <span class="panelTitle" ng-bind="Form.title"></span>
    </div>
    <div class="panel-body">
      <form novalidate name="tuanForm" class="form-horizontal" role="form">
        <div class="form-group" ng-class="{'has-error': tuanForm.name.$invalid && tuanForm.name.$dirty}">
          <label class="control-label col-xs-3 col-md-2">拼团商品：</label>
          <div class="col-xs-7 col-md-8">
            <input type="text" class="form-control w25c fl" readonly="readonly" name="artworkId" placeholder="拼团商品" ng-model="tuan.artworkId" required>
            <button class="btn btn-primary fl" data-toggle="modal" data-target="#chooseProductModal">选择商品</button>
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': tuanForm.name.$invalid && tuanForm.name.$dirty}">
          <label class="control-label col-xs-3 col-md-2">拼团名称：</label>
          <div class="col-xs-7 col-md-8">
            <input type="text" class="form-control w50c" name="name" placeholder="拼团名称" ng-model="tuan.name" required>
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': tuanForm.sellPoint.$invalid && tuanForm.sellPoint.$dirty}">
          <label class="control-label col-xs-3 col-md-2">商品卖点：</label>
          <div class="col-xs-7 col-md-8">
            <input type="text" class="form-control w50c" name="sellPoint" placeholder="商品卖点" ng-model="tuan.sellPoint">
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': tuanForm.content.$invalid && tuanForm.content.$dirty}">
          <label class="control-label col-xs-3 col-md-2">拼团规则：</label>
          <div class="col-xs-7 col-md-8">
            <textarea name="content" placeholder="拼团规则" id="editor" bind-model="tuan.content" ng-bind-html="tuan.content | trustHtml" keditor data-config="options" required ng-model="tuan.contentBody">
            </textarea>
            <autosave module="tuan" saveId="{{tuan.id}}" interval="30000"></autosave>
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': tuanForm.fieldPrice.$invalid && tuanForm.fieldPrice.$dirty}">
          <label class="control-label col-xs-3 col-md-2">市场价：</label>
          <div class="col-xs-7 col-md-8">
            <input type="number" class="form-control w25c" name="fieldPrice" placeholder="市场价" ng-model="tuan.fieldPrice" required>
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': tuanForm.buttomFee.$invalid && tuanForm.buttomFee.$dirty}">
          <label class="control-label col-xs-3 col-md-2">拼团价：</label>
          <div class="col-xs-7 col-md-8">
            <input type="number" class="form-control w25c" name="buttomFee" placeholder="拼团价" ng-model="tuan.buttomFee" required>
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': tuanForm.limitCount.$invalid && tuanForm.limitCount.$dirty}">
          <label class="control-label col-xs-3 col-md-2">拼团人数：</label>
          <div class="col-xs-7 col-md-8">
            <input type="number" class="form-control w25c" name="limitCount" placeholder="拼团人数" ng-model="tuan.limitCount" required>
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': tuanForm.stock.$invalid && tuanForm.stock.$dirty}">
          <label class="control-label col-xs-3 col-md-2">库存：</label>
          <div class="col-xs-7 col-md-8">
            <input type="number" class="form-control w25c" name="stock" placeholder="库存" ng-model="tuan.stock" required>
          </div>
        </div>
        <div class="form-group" ng-class="{'has-error': tuanForm.startTime.$invalid && tuanForm.startTime.$dirty}">
          <label class="control-label col-xs-3 col-md-2">起止时间：</label>
          <div class="col-xs-7 col-md-8">
            <input type="text" class="form-control w25c fl" name="startTime" id="startTime" itime2 placeholder="开始时间" ng-model="tuan.strStartDate" required> <span class="to fl">至</span> <input type="text" class="form-control w25c fl" name="endTime" id="endTime" itime2 placeholder="结束时间" ng-model="tuan.strEndDate" required>
          </div>
        </div>
        <div class="form-group">
          <label class="control-label col-xs-3 col-md-2">产品图：</label>
          <div class="col-xs-7 col-md-8">
            <div class="button btn btn-primary fl" ngf-select="upload($file)" ngf-pattern="'image/*'"
              ngf-accept="'image/*'" ngf-max-size="10MB">上传图片</div>
            <a href="javascript:void(0)" class="btn btn-info ml15" ng-click="openPhotoLibs()">图片库</a><span class="clearfix"></span>
            <bannerlist></bannerlist>
          </div>
        </div>
        <div class="form-group">
          <div class="col-xs-4 col-xs-offset-2">
            <button class="btn btn-primary" ng-click="submitForm()" ng-disabled="tuanForm.$invalid">保存</button>
            <button class="btn btn-white" ng-click="discard()">取消</button>
          </div>
        </div>
      </form>
    </div>
  </div>
</div>
<imagepreview></imagepreview>
<upload-task></upload-task>

<script src="libs/kindeditor/kindeditor.js" type="text/javascript"></script>
<script src="libs/kindeditor/lang/zh-CN.js" type="text/javascript"></script>